package cn.com.cifi.mars.web.action.sys;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import cn.com.cifi.mars.bean.vo.sys.rsp.DictionaryVo;
import cn.com.cifi.mars.common.base.BaseAction;
import cn.com.cifi.mars.common.bean.R;
import cn.com.cifi.mars.service.SysDictionaryService;

/**
 * <p>
 * 数据字典
 * </p>
 *
 * @author yyd
 * @since 2019-09-12
 */
@RestController
public class SysDictionaryController extends BaseAction implements ISysDictionaryController{

	@Autowired
	private SysDictionaryService sysDictionaryService;

	
	/**
	 * 数据字典下拉框
	 */
	@Override
	public R<String> getDictionaryList(String apiVersion) {
        return ok(sysDictionaryService.queryDictionarySelect());
	}
	

	/**
	 * 分页查询数据字典
	 */
	@Override
	public R<DictionaryVo> getDictionaryPage(String apiVersion, String current, String pageSize, String typeCode,String dictName) {
        return ok(sysDictionaryService.querySysDictionaryPage(dictName, typeCode, current, pageSize));
	}


	/**
	 * 根据字典类型code显示不同的下拉框数据
	 */
	@Override
	public R<String> getDictionaryByTypeCode(String apiVersion, String typeCode) {
        return ok(sysDictionaryService.queryDictionaryByTypeCode(typeCode));
	}
}
